package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiT_erp_log_hist;

//DAO
public interface T_erp_log_histMapperBase {

	//根据id查看
    @Select("SELECT * FROM t_erp_log_hist  WHERE id = #{id}")
	public ApiT_erp_log_hist findT_erp_log_histById(Integer id);
	
    //查看数据集
    @Select("SELECT * FROM T_erp_log_hist")
	public List<ApiT_erp_log_hist> findT_erp_log_hists();
	
	//添加
    @Insert("INSERT INTO t_erp_log_hist (goods_id, products_id, action, order_id, invoke_time, status, remark) VALUES (#{goods_id}, #{products_id}, #{action}, #{order_id}, #{invoke_time}, #{status}, #{remark})")
 	@Options(useGeneratedKeys = true, keyProperty = "id")
    public int insertT_erp_log_hist(ApiT_erp_log_hist t_erp_log_hist);
  	
	//修改
    @Update("UPDATE t_erp_log_hist SET goods_id = #{goods_id}, products_id = #{products_id}, action = #{action}, order_id = #{order_id}, invoke_time = #{invoke_time}, status = #{status}, remark = #{remark} WHERE id = #{id}")
    public int updateT_erp_log_hist(ApiT_erp_log_hist t_erp_log_hist);
    
    //删除
    @Delete("DELETE FROM t_erp_log_hist  WHERE id = #{id}")
    public int deleteT_erp_log_hist(Integer id);
 
    // Foreign keys revelant		
		

	//region Indexs revelant
    
    
    //获取根据order_id	
    @Select("SELECT id, goods_id, products_id, action, order_id, invoke_time, status, remark FROM t_erp_log_hist  WHERE order_id = #{order_id}")	
    public List<ApiT_erp_log_hist> findT_erp_log_histsByOrder_id(String order_id);
    		
    
}


